package com.lightboat.system.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.lightboat.system.domain.CrmOrder;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 订单Mapper接口
 * 
 * @author lightboat
 * @date 2025-08-14
 */
@Mapper
@Repository
public interface CrmOrderMapper extends BaseMapper<CrmOrder> {

    /**
     * 查询订单
     * 
     * @param orderId 订单主键
     * @return 订单
     */
    public CrmOrder selectCrmOrderByOrderId(Long orderId);

    /**
     * 查询订单列表
     * 
     * @param crmOrder 订单
     * @return 订单集合
     */
    public List<CrmOrder> selectCrmOrderList(@Param("order") CrmOrder crmOrder, @Param(Constants.WRAPPER) Wrapper<?> queryWrapper);

    /**
     * 删除订单
     * 
     * @param orderId 订单主键
     * @return 结果
     */
    public int deleteCrmOrderByOrderId(Long orderId);

    /**
     * 批量删除订单
     * 
     * @param orderIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteCrmOrderByOrderIds(Long[] orderIds);

    /**
     * 查询公海订单
     * @param crmOrder
     * @return
     */
    List<CrmOrder> selectHighSeasOrderList(@Param("order") CrmOrder crmOrder);
}
